<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--<%@ include file="../include/admincontent.jsp" %>--%>
<link rel="stylesheet" href="../resources/js/plugins/TreeTable/css/jquery.treeTable.css"/>
<link rel="stylesheet" href="../resources/css/knowlegPoints.css"/>
<link rel="stylesheet" href="../resources/css/index.css"/>

<div>
    <c:choose>
        <c:when test="${findFlag==1}">
            <div style="background:#eee;">
                <div class="papertop"></div>
                <div class="paperbtn"><button type="button" onclick="PrintPaper();">打印试卷</button></div>
                <!--startprint-->
                <div class="paperwidth">
                    <div class="papername">${paperName}</div>
                    <div class="paperpoint">[ 试卷用途：${paperPurpose}&emsp;试卷类型：${paperType}&emsp;试卷总分：${totalScore} ]</div>
                    <div class="paperinfo"><p>${paperNameTitle}</p></div>
                    <!--   <div class="paperpart">第一部分 </div> -->
                    <c:if test="${!empty titleNum0}">
                        <div class="paperpart">${titleNum0}、${titleType0} 每题${scoreQuestion0}分，共${totalTopics0}道题目，总分：${allCount0}分。</div>
                        <c:forEach items="${sChoose}" var="item">
                            <div class="dxtitle">${item.tN}、${item.tContent}</div>
                            <div class="dxoption">
                                <span class="dxitem">${item.tNS0}</span>
                                <span class="dxitem">${item.tNS1}</span>
                                <span class="dxitem">${item.tNS2}</span>
                                <span class="dxitem">${item.tNS3}</span>
                            </div>
                        </c:forEach>
                        <div class="clear"></div>
                    </c:if>
                    <c:if test="${!empty titleNum1}">
                        <div class="paperpart">${titleNum1}、${titleType1} 每题${scoreQuestion1}分，共${totalTopics1}道题目，总分：${allCount1}分。</div>
                        <c:forEach items="${mChoose}" var="item">
                            <div class="dxtitle">${item.tN}、${item.tContent}</div>
                            <div class="dxoption">
                                <span class="dxitem">${item.tNS0}</span>
                                <span class="dxitem">${item.tNS1}</span>
                                <span class="dxitem">${item.tNS2}</span>
                                <span class="dxitem">${item.tNS3}</span>
                                <span class="dxitem">${item.tNS4}</span>
                            </div>
                        </c:forEach>
                        <div class="clear"></div>
                    </c:if>
                    <c:if test="${!empty titleNum2}">
                        <div class="paperpart">${titleNum2}、${titleType2} 每题${scoreQuestion2}分，共${totalTopics2}道题目，总分：${allCount2}分。</div>
                        <c:forEach items="${completion}" var="item">
                            <div class="dxtitle">${item.tN}、${item.tContent}</div>
                        </c:forEach>
                        <div class="clear"></div>
                    </c:if>
                    <c:if test="${!empty titleNum3}">
                        <div class="paperpart">${titleNum3}、${titleType3} 每题${scoreQuestion3}分，共${totalTopics3}道题目，总分：${allCount3}分。</div>
                        <c:forEach items="${trues}" var="item">
                            <div class="dxtitle">${item.tN}、${item.tContent}</div>
                            <div class="dxoption">正确（ ）&emsp;&emsp;&emsp;错误（ ）</div>
                        </c:forEach>
                        <div class="clear"></div>
                    </c:if>
                    <c:if test="${!empty titleNum4}">
                        <div class="paperpart">${titleNum4}、${titleType4} 每题${scoreQuestion4}分，共${totalTopics4}道题目，总分：${allCount4}分。</div>
                        <c:forEach items="${simples}" var="item">
                            <div class="dxtitle">${item.tN}、${item.tContent}</div>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                        </c:forEach>
                        <p style="height: 16px"></p>
                    </c:if>
                    <c:if test="${!empty titleNum5}">
                        <div class="paperpart">${titleNum5}、${titleType5} 每题${scoreQuestion5}分，共${totalTopics5}道题目，总分：${allCount5}分。</div>
                        <c:forEach items="${summary}" var="item">
                            <div class="dxtitle">${item.tN}、${item.tContent}</div>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                            <p style="height: 16px"></p>
                        </c:forEach>
                        <p style="height: 16px"></p>
                    </c:if>
                </div>
                <!--endprint-->
                <div class="paperbottom"></div>
            </div>

        </c:when>
        <c:otherwise>
            <div>
                <br><br><br>
                <span style="color: red;font-weight: bold">
                    &nbsp;&nbsp;&nbsp;&nbsp;可能由于题目被删除等情况，导致该试卷被抽查的题目存在异常，请尝试修改试卷，重新生成试卷,或者在试卷题目管理中选择新的题目。
                </span>
            </div>
        </c:otherwise>
    </c:choose>
</div>

<script type="text/javascript" src="../resources/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../resources/js/actions.js"></script>
<script src="../resources/js/fadeInout.js" type="text/javascript"></script>

<script type="text/javascript" language="javascript">

    function PrintPaper() {
        $('.paperpoint').hide();
        $('.paperwidth').css("font-size", "22px");
        $('.paperwidth').css("color", "#000");
        $('.papername').css("font-size", "30px");
        $('.paperpart').css("font-size", "24px");
        bdhtml = window.document.body.innerHTML; //获取当前页的html代码
        sprnstr = "<!--startprint-->"; //设置打印开始区域
        eprnstr = "<!--endprint-->"; //设置打印结束区域
        prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 17); //从开始代码向后取html
        prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
        window.document.body.innerHTML = prnhtml;
        window.print();
        window.document.body.innerHTML = bdhtml;
        $('.paperpoint').show();
        $('.paperwidth').css("font-size", "14px");
        $('.paperwidth').css("color", "#555");
        $('.papername').css("font-size", "24px");
        $('.paperpart').css("font-size", "14px");
    }

</script>